package com.caul.demo.hbase;

import java.util.Map;

/**
 * Created by sdliang on 2018/4/18.
 */
public class HBaseRow {

  /**
   * 行键
   */
  private String rowId;
  /**
   * 列值
   */
  private Map<HBaseColumn, String> data;

  public HBaseRow(String rowId) {
    this.rowId = rowId;
  }

  public String getRowId() {
    return rowId;
  }

  public void setRowId(String rowId) {
    this.rowId = rowId;
  }

  public Map<HBaseColumn, String> getData() {
    return data;
  }

  public void setData(Map<HBaseColumn, String> data) {
    this.data = data;
  }

  public static class HBaseColumn {

    /**
     * 列族名
     */
    private String family;
    /**
     * 列名
     */
    private String name;

    public HBaseColumn(String family, String name) {
      this.family = family;
      this.name = name;
    }

    public String getFamily() {
      return family;
    }

    public void setFamily(String family) {
      this.family = family;
    }

    public String getName() {
      return name;
    }

    public void setName(String name) {
      this.name = name;
    }

    @Override
    public String toString() {
      if (family == null) {
        return name;
      }
      return family + "." + name;
    }
  }
}
